<template>
  <div>
    <div>
      <h1>付款成功</h1>
      <div><router-link to="/setorder">返回</router-link></div>
    </div>
    <!-- 提示音 -->
    <welcomeAudioTip
      :audiourl="welcomeAudioTipurl"
      ref="child"
    ></welcomeAudioTip>
  </div>
</template>
<script>
import welcomeAudioTip from "@/components/welcomeAudioTip.vue";
export default {
  name: "FukuanView",
  components: {
    welcomeAudioTip,
  },
  data() {
    return {
      welcomeAudioTipurl: require("@/assets/media/pay_success.mp3"), //初始化欢迎提示音,
    };
  },
  mounted() {
    this.paymentSuccess();
  },
  methods: {
    //支付成功后的提示音
    paymentSuccess() {
      //点击下单结算，更换子组件音频地址并重新播放
      this.welcomeAudioTipurl = require("@/assets/media/pay_success.mp3");
      //调用子组件方法
      this.$refs.child.play();
    },
  },
};
</script>
<style scoped>
</style>